package com.windfone.web.action;

import com.opensymphony.xwork2.ActionSupport;
import com.windfone.common.OrderUtil;
import com.windfone.model.Goodsqryorder;
import com.windfone.model.ReceiveMsg;
import com.windfone.service.CommonService;
import com.windfone.service.OrderService;

public class GoodsqryorderAction extends ActionSupport {

	/**	 */
	private static final long serialVersionUID = 1L;
	private CommonService commonService;
	private OrderService orderService;
	private String orderSeq;
	private ReceiveMsg receiveMsg;
	public void setOrderService(OrderService orderService) {
		this.orderService = orderService;
	}

	private String name;

	private String orderseq;

	private String sendOrderSeq;

	public void setCommonService(CommonService commonService) {
		this.commonService = commonService;
	}

	public String beforeAddGoodsqryorder() throws Exception {
		receiveMsg = orderService.getReceiveMsgByOrderId(orderSeq);
		return SUCCESS;
	}
	
	public ReceiveMsg getReceiveMsg() {
		return receiveMsg;
	}

	public void setReceiveMsg(ReceiveMsg receiveMsg) {
		this.receiveMsg = receiveMsg;
	}

	public String addGoodsqryorder() throws Exception {
		Goodsqryorder bean = new Goodsqryorder();
		int keygroup =OrderUtil.getDateInt();;
		bean.setKeygroup(keygroup);
		bean.setName(name);
		bean.setOrderseq(orderseq);	
		bean.setSendOrderSeq(sendOrderSeq);
		commonService.inserGoodsqryorder( bean );
		return SUCCESS;
	}

}
